home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / RCSC.ZIP / LIB51 / STRRCHR.C < prev    next >
C/C++ Source or Header  |  1997-01-12  |  331b  |  17 lines

  1. /*
  2. ** strrchr(s,c) - Search s for rightmost occurrance of c.
  3. ** s      = Pointer to string to be searched.
  4. ** c      = Character to search for.
  5. ** Returns pointer to rightmost c or NULL.
  6. */
  7. strrchr(s, c) char *s, c; {
  8.   char *ptr;
  9.   ptr = 0;
  10.   while(*s) {
  11.     if(*s==c) ptr = s;
  12.     ++s;
  13.     }
  14.   return (ptr);
  15.   }
  16.  
  17.